package keer.httpinterface.test;

import java.util.Arrays;
import java.util.List;

public class DemoResult {
    private String name;
    private int age;
    private List<String> array;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<String> getArray() {
        return array;
    }

    public void setArray(List<String> array) {
        this.array = array;
    }

    public static DemoResult create(String name, int arg, String... arrayItem) {
        DemoResult result = new DemoResult();
        result.name = name;
        result.age = arg;
        result.array = Arrays.asList(arrayItem);
        return result;
    }

    @Override
    public String toString() {
        return "name=" + name
                + ",age=" + age
                + ",array=" + (array == null ? "[]" : array.toString());
    }
}
